package com.xuhuan.thread.study2.create;


/**
 * @author huan.xu
 * @date 2021/9/28 18:15
 * @description 线程创建方式一：集成Thread类，重写run方法，调用start方法启动线程
 */
public class CreateThreadDemo1 extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println("创建的线程:"+i);
        }
    }

    public static void main(String[] args) {
        CreateThreadDemo1 demo1 = new CreateThreadDemo1();
        demo1.start();

        for (int i = 0; i < 20; i++) {
            System.out.println("主线程:"+i);
        }
    }

}
